//package com.yewen.http.controller;
//
//import com.alibaba.fastjson.JSONObject;
//import com.rabbitmq.client.*;
//import com.yewen.http.core.vo.CommonResult;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.io.IOException;
//import java.util.concurrent.TimeoutException;
//
///**
// * @Classname LeaveMessageHandler
// * @Description 留言功能的实现
// * @Date 2022/4/9 20:40
// * @Created by TaoVh
// */
//@RestController
//@RequestMapping("/yewen/leaveMessage")
//public class LeaveMessageHandler {
//    public final static ConnectionFactory factory = new ConnectionFactory();
//    public static Connection connection;
//    public static final String exchangeName = "yewen.leave.message";
//    static {
//        factory.setVirtualHost("taotao_vhost");
//        factory.setHost("localhost");
//        factory.setPort(5672);
//        factory.setUsername("taotao");
//        factory.setUsername("VANvan130533");
//        try {
//            connection = factory.newConnection("业问留言");
//        } catch (IOException e) {
//            e.printStackTrace();
//        } catch (TimeoutException e) {
//            e.printStackTrace();
//        }
//    }
//    @PostMapping
//    public CommonResult<String> leaveMessage(String toUser,String content,String fromUser){
//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("fromUser",fromUser);
//        jsonObject.put("content",content);
////        try(Channel channel = connection.createChannel()){
////            channel.queueBind()
////            channel.basicPublish(exchangeName,routeKEY, MessageProperties.PERSISTENT_TEXT_PLAIN,);
////        }catch (Exception e){
////
////        }
//        return CommonResult.success("1");
//
//    }
//}
